#ifndef __DICTPRODUCER_H_
#define __DICTPRODUCER_H_
#include <vector>
#include <string>
#include <map>
#include "SplitTool.h"
class DictProducer {
 protected:
  std::vector<std::string> _files;
  std::map<std::string, int> _dict;
  std::map<std::string, std::set<int>> _index;
 public:
  DictProducer(const std::string& dir);
  void showDict() const;
  void showIndex() const;
};
class EnglishDictProducer : public DictProducer {
 public:
  EnglishDictProducer(const std::string& dir) : DictProducer(dir) {}
  void buildDict();
  void storeDict(const std::string& filepath);
};
class ChineseDictProducer : public DictProducer {
 public:
  ChineseDictProducer(const std::string& dir) : DictProducer(dir) {}
  void buildDict(SplitToolCppJieba& split);
  void storeDict(const std::string& filepath);
};
#endif